

package org.winexpress

/**
 *
 * @author Swee Zhi
 */
class WineVarietal {
    // e.g. chardonnay, Cabernet Sauvignon, Pinot Noir
    int id
    String wineVarietalName
    String description
    
    static hasOne = [wineType:WineType]
//    static belongsTo = WineTypes // for bi-directional to determine the owning entity

    static mapping = {
        description type: 'text'
    }

    static constraints = {
        id(blank:false, unique:true)
        wineVarietalName(blank:false, unique:true)
        description(blank:true)
        wineType(blank:false)
    }
}

